﻿
namespace mVu
{
  public delegate void DownloadCompleteHandler(string fileName);

  class DownloadThread
  {
    public event DownloadCompleteHandler CompleteCallback;
    public event DownloadProgressHandler ProgressCallback;

    public string Url { get; set; }
    public string Filename { get; set; }
    public DownloadItem Item { get; set; }

    public void Download()
    {
      if (CompleteCallback != null && Url != "")
      {
        var download = new Download();
        download.DownloadFile(Url, Filename, Item, ProgressCallback);
        CompleteCallback(Filename);
      }
    }
  }
}
